package com.model;

import java.util.ArrayList;
import java.util.List;

public class Exercises_ {
	private Integer id;
	private String question;
	private List<Option> options;
	private Integer answer;
	public Exercises_(Exercises exer){
		this.id = exer.getId();
		this.question = exer.getQuestion();
		this.answer = exer.getAnswer();
		String[] options=exer.getOptions().split("@@");
		List<Option> ops = new ArrayList<Option>();
		for(int i=0;i<options.length;i++){
			Option option = new Option();
			option.setId(i+1);
			option.setOption(options[i]);
			ops.add(option);
		}
		this.options = ops;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getQuestion() {
		return question;
	}
	public void setQuestion(String question) {
		this.question = question;
	}
	public List<Option> getOptions() {
		return options;
	}
	public void setOptions(List<Option> options) {
		this.options = options;
	}
	public Integer getAnswer() {
		return answer;
	}
	public void setAnswer(Integer answer) {
		this.answer = answer;
	}
	
}
